// package: rewords-server-2024
// filename: bczAPI
// author: diogoxiang@gmail.com
// time: 2024/11/29 15:15

package bczAPI

import (
	"rewords-server-2024/internal/model/entity"
	"rewords-server-2024/internal/model/input/query_in"

	"github.com/gogf/gf/v2/frame/g"
)

// BaseListReq 通用列表请求结构
type BaseListReq struct {
	g.Meta         `path:"/bcz/words/list" method:"post" summary:"列表请求" tags:"bcz"`
	Conditions     []query_in.Condition  `json:"conditions,omitempty" summary:"查找条件"`   // 查找字段
	OrderFields    []query_in.OrderField `json:"order_fields,omitempty" summary:"排序字段"` // 排序字段
	*query_in.Page `json:"page"`         // 分页
}

// BaseListRes 通用列表响应结构
type BaseListRes struct {
	List []entity.BczWord `json:"list"` // 使用interface{}以支持不同类型的列表数据
	query_in.PageResult
}

// BaseAddReq 通用添加请求结构
type BaseAddReq struct {
	g.Meta `path:"/bcz/words/add" method:"post" summary:"添加请求" tags:"bcz"`
	entity.BczWord
}

// BaseAddRes 通用添加响应结构
type BaseAddRes struct {
	Id string `json:"id" summary:"记录ID"`
}

// BaseInfoReq 通用信息请求结构
type BaseInfoReq struct {
	g.Meta `path:"/bcz/words/info" method:"get" summary:"信息请求" tags:"bcz"`
	Q      string `json:"q" v:"required#Q不能为空" dc:"记录Q"`
}

// BaseInfoRes 通用信息响应结构
type BaseInfoRes struct {
	entity.BczWord
}

// BaseUpdateReq 通用更新请求结构
type BaseUpdateReq struct {
	g.Meta `path:"/bcz/words/update" method:"put" summary:"更新请求" tags:"bcz"`
	//Id     string `json:"id" v:"required#ID不能为空" dc:"记录ID"`
	entity.BczWord
}

// BaseUpdateRes 通用更新响应结构
type BaseUpdateRes struct {
	//Id string `json:"id" summary:"记录ID"`
}

// BaseDeleteReq 通用删除请求结构
type BaseDeleteReq struct {
	g.Meta `path:"/bcz/words/del" method:"post" summary:"删除请求" tags:"bcz"`
	Id     string `json:"ids" v:"required#word不能为空" dc:"记录word"`
}

// BaseDeleteRes 通用删除响应结构
type BaseDeleteRes struct{}
